// Copyright©,2020-2025
// Author: caocheng
// Version: 1.0.0
// Date: 2021/3/11 13:26
// Description：
package SummerUtils

import (
	"io/ioutil"
	"path/filepath"
)

func ScanFiles(path string) []string {
	var files []string
	infolist, err := ioutil.ReadDir(path) //specify the current dir
	if err != nil {
		panic(err)
	}
	for _, info := range infolist {
		filename := filepath.Join(path, info.Name())
		if info.IsDir() {
			files = append(files, ScanFiles(filename)...)
		} else {
			files = append(files, filename)
		}
	}

	return files
}
